package cn.yunhe.dplayerdemo3.Service.impl;

import cn.yunhe.dplayerdemo3.Service.ICoinService;
import cn.yunhe.dplayerdemo3.entity.Coin;
import cn.yunhe.dplayerdemo3.mapper.ICoinMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CoinService extends ServiceImpl<ICoinMapper, Coin> implements ICoinService {

    @Autowired
    private ICoinMapper coinMapper;

    @Override
    public boolean addCoin(Coin coin) {
        if (coinMapper.addCoin(coin)>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Coin getCoin(Coin coin) {
        return coinMapper.getCoin(coin);
    }
}
